﻿Public Class OptionsWindow

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.Windows.RoutedEventArgs) Handles Button1.Click
        If CInt(TxtPoints.Text) > 0 Then
            My.Settings.Points2Win = CInt(TxtPoints.Text)
        End If
        My.Settings.Save()
        Me.Hide()

    End Sub

    Private Sub RadioButton1_Checked(ByVal sender As System.Object, ByVal e As System.Windows.RoutedEventArgs) Handles RadioButton1.Checked
        My.Settings.TrumpSet = 0
    End Sub

    Private Sub RadioButton2_Checked(ByVal sender As System.Object, ByVal e As System.Windows.RoutedEventArgs) Handles RadioButton2.Checked
        My.Settings.TrumpSet = 1
    End Sub

    Private Sub RadioButton3_Checked(ByVal sender As System.Object, ByVal e As System.Windows.RoutedEventArgs) Handles RadioButton3.Checked
        My.Settings.TrumpSet = 2
    End Sub

    Private Sub OptionsWindow_Loaded(ByVal sender As Object, ByVal e As System.Windows.RoutedEventArgs) Handles Me.Loaded
        TxtPoints.Text = My.Settings.Points2Win.ToString
        Select Case My.Settings.TrumpSet
            Case Is = 0
                RadioButton1.IsChecked = True
                RadioButton2.IsChecked = False
                RadioButton3.IsChecked = False
            Case Is = 1
                RadioButton1.IsChecked = False
                RadioButton2.IsChecked = True
                RadioButton3.IsChecked = False
            Case Is = 2
                RadioButton1.IsChecked = False
                RadioButton2.IsChecked = False
                RadioButton3.IsChecked = True
        End Select
        If My.Settings.UseSound = True Then
            CheckBox1.IsChecked = True
        Else
            CheckBox1.IsChecked = False
        End If
        LblVersion.Content = "Version " & My.Application.Info.Version.ToString
        LblCopyright.Content = My.Application.Info.Copyright.ToString
    End Sub

   
    Private Sub Image1_MouseDown(ByVal sender As System.Object, ByVal e As System.Windows.Input.MouseButtonEventArgs) Handles Image1.MouseDown
        RadioButton1.IsChecked = True
        RadioButton1_Checked(sender, e)
    End Sub

    Private Sub Image2_MouseDown(ByVal sender As System.Object, ByVal e As System.Windows.Input.MouseButtonEventArgs) Handles Image2.MouseDown
        RadioButton2.IsChecked = True
        RadioButton2_Checked(sender, e)
    End Sub

    Private Sub Image3_MouseDown(ByVal sender As System.Object, ByVal e As System.Windows.Input.MouseButtonEventArgs) Handles Image3.MouseDown
        RadioButton3.IsChecked = True
        RadioButton3_Checked(sender, e)
    End Sub
End Class
